package com.xiaoxin.controller;

import com.xiaoxin.domain.User2;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * swagger3 用法示例
 *
 * @author ZhangXX
 */
@RestController
@RequestMapping("/testuser1")
public class UserTwoController {

    /**
     * 上传请求
     * 必须使用 @RequestPart 注解标注为文件
     *
     * @param user
     * @return
     */
    @SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
    @PostMapping("/createOne2")
    public ResponseEntity<User2> createOne1(User2 user) {
        return ResponseEntity.ok(user);
    }

}
